<template>
	<view class="orderMainAre">
		<view class="calc display column orderAre borderR">
			<view class="display flow titleAre">
				<image src="/static/images/icon/shopIcon.png" style="width: 32rpx;height: 29rpx;"></image>
				<text class="shopName">{{goodsList.supplier_content.supplier_name}}</text>
				<uni-icons :type="'arrowright'" :color="'grey'" size="16" />
			</view>
			<view class="display flow orderItemAre">
				<image :src="goodsList.head_img" class="shopImg" ></image>
				<view class="display column orderItem" style="width: 55%;">
					<text class="fontHide2" style="margin-bottom: 10rpx;">{{goodsList.product_name}}</text>
				</view>
				<view class="display column orderItem" style="align-items: flex-end;">
					<text class="price">{{goodsList.integral}}积分</text>
					<text class="pColor">x{{goodsList.goodsNum}}</text>
				</view>
			</view>
			<view class="display column mainAre">
				<view class="display flow mainItem">
					<text>我的积分</text>
					<text>{{integral}}</text>
				</view>
				<view class="display flow mainItem">
					<text>运费</text>
					<text>包邮</text>
				</view>
				<view class="display flow mainItem">
					<text>订单备注</text>
					<input class="input" type="text" @input="InputVal" placeholder="选填,请先和商家协商一致"/>
				</view>
				<view class="display flow mainItem" style="justify-content: flex-end;">
					<text class="pColor" style="margin-right: 10rpx;">共{{goodsList.goodsNum}}件</text>
					<text>小计： <text class="price">{{totalNum}}积分</text></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import util from '@/common/util.js'
	import {mapState} from 'vuex'
	export default {
		name: "orderList",
		props: ['goodsList','type'],
		computed:{
			...mapState(['integral']),
			totalNum(){
				var that = this
				if(that.goodsList){
					that.total = util.calculate(that.goodsList.integral,that.goodsList.goodsNum)
				}
				return Number(that.total).toFixed(2)
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			InputVal(e){
				this.$emit('InputVal',e)
			}
		}
	}
</script>

<style lang="scss">
	@import '@/common/css/orderList.scss';
</style>
